<?php
/**
 * Created by PhpStorm.
 * User: woody
 * Date: 18-10-8
 * Time: 下午2:07
 */
namespace App\Http\Controllers\Api;

use App\Models\Bannerapi;

use Config;
class BannerController extends ApiController {


    public function __construct()
    {
        parent::__construct();
        $this->_response['_active']['_model']       = 'banner';
        $this->_response['_active']['_action']      = '';
        $this->_response['_title']                  = '小一农货-广告图管理';

    }

    public function index(){

        $this->_response['_active']['_action']      = 'list';

        $bannerModel = new Bannerapi();

        $data = $bannerModel->getData();

        if(!empty($data)){
            $this->_response['banner'] = $data;
            return response()->json(['code' => 0, 'msg' => '返回成功','data'=>$this->_response]);
        }else{
            return response()->json(['code' => -1, 'msg' => '返回失败']);
        }
    }



}